import { observable, action } from 'mobx';

export default class appState {
  constructor({name, basics} = {name: 'zhuxiaohui', basics: []}) {
    this.name = name;
    this.basics = basics;
  }
  @observable name;
  @observable basics;

  @action changeName(name) {
    this.name = name;
  }
  @action getBasic(data) {
    this.basics = data;
  }
  toJson() {
    return {
      name: this.name,
      basics: this.basics,
    }
  }
}